package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloController {

    @RequestMapping("/hello")
    public ModelAndView Hello(){
        ModelAndView mv=new ModelAndView();
        mv.addObject("msg","成功");
        mv.setViewName("index");
        return mv;

    }
}
